package com.turing.selfwebservice.cardholderuser;

public class AccountTradDetailObj {
	private String subAccNo;// 子账户好
	private String tranDate;// 交易日期
	private String tranTime;// 交易时间
	private String tranType;// 交易类型
	private String debitAmount;// 借方发生额
	private String creditAmount;// 贷方发生额
	private String balance;// 余额
	private String remark;// 交易摘要

	public AccountTradDetailObj() {
		super();
	}

	public AccountTradDetailObj(String tranTime, String tranType,
			String debitAmount, String creditAmount, String balance,
			String remark) {
		super();
		this.tranTime = null == tranTime ? "" : tranTime;
		this.tranType = getTranType(tranType);
		this.debitAmount = null == debitAmount ? "" : debitAmount;
		this.creditAmount = null == creditAmount ? "" : creditAmount;
		this.balance = null == balance ? "" : balance;
		this.remark = null == remark ? "" : remark;
	}

	public AccountTradDetailObj(String subAccNo, String tranDate,
			String tranTime, String tranType, String debitAmount,
			String creditAmount, String balance, String remark) {
		super();
		this.subAccNo = subAccNo;
		this.tranDate = null == tranDate ? "" : tranDate;
		this.tranTime = null == tranTime ? "" : tranTime;
		this.tranType = getTranType(tranType);
		this.debitAmount = null == tranTime ? "" : tranTime;
		this.creditAmount = null == creditAmount ? "" : creditAmount;
		this.balance = null == balance ? "" : balance;
		this.remark = null == remark ? "" : remark;
	}

	public String getSubAccNo() {
		return subAccNo;
	}

	public void setSubAccNo(String subAccNo) {
		this.subAccNo = subAccNo;
	}

	public String getTranDate() {
		return tranDate;
	}

	public void setTranDate(String tranDate) {
		this.tranDate = tranDate;
	}

	public String getTranTime() {
		return tranTime;
	}

	public void setTranTime(String tranTime) {
		this.tranTime = null == tranTime ? "" : tranTime;
	}

	public String getTranType() {
		return tranType;
	}

	public void setTranType(String tranType) {
		this.tranType = getTranType(tranType);
	}

	public String getDebitAmount() {
		return debitAmount;
	}

	public void setDebitAmount(String debitAmount) {
		this.debitAmount = null == debitAmount ? "" : debitAmount;
	}

	public String getCreditAmount() {
		return creditAmount;
	}

	public void setCreditAmount(String creditAmount) {
		this.creditAmount = creditAmount;
	}

	public String getBalance() {
		return balance;
	}

	public void setBalance(String balance) {
		this.balance = balance;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = null == remark ? "" : remark;
	}

	private String getTranType(String tranType) {
		if ("00".equals(tranType))
			return "开户";
		if ("10".equals(tranType))
			return "开户撤销";
		if ("01".equals(tranType))
			return "消费";
		if ("11".equals(tranType))
			return "消费撤销";
		if ("02".equals(tranType))
			return "充值";
		if ("12".equals(tranType))
			return "充值撤销";
		if ("03".equals(tranType))
			return "赎回";
		if ("13".equals(tranType))
			return "赎回撤销";
		if ("04".equals(tranType))
			return "扣手续费";
		if ("14".equals(tranType))
			return "扣手续费撤销";
		if ("99".equals(tranType))
			return "调帐";
		return "未知类型";
	}
}
